package com.neuedu.corejava.ch6.homeword;

//import org.omg.CORBA.PUBLIC_MEMBER;
//1、定义一个点类Point，包含2个成员变量x、y分别表示x和y坐标，2个构造器Point()和Point(int x0,y0),
//以及一个movePoint（int dx,int dy）方法实现点的位置移动，
//创建两个Point对象p1、p2，分别调用movePoint方法后，打印p1和p2的坐标。[必做题]

public class Point {
	
	private int x;
	private int y;
	
	public Point() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Point(int x0, int y0) {
		super();
		this.x = x0;
		this.y = y0;
		
	}
	
	public void movePoint(int dx,int dy){
		dx=x+20;
		dy=y+20;
		System.out.println("x的坐标为："+dy+"  "+"y的坐标为："+dy);
		
	}	
	
	public static void main(String[] args) {
		Point p1=new Point();
		Point p2=new Point();
		
		p1.x=1;p1.y=2;
		
		p2.x=3;p2.y=4;
		
		System.out.println("p1移动后的坐标为：");
		p1.movePoint(p1.x,p1.y);
		
		System.out.println("p2移动后的坐标为：");
		p2.movePoint(p2.x, p2.y);
		
	}
	

}
